package com.example.demo.config;

import com.example.demo.common.Model;
import com.example.demo.common.ModelEncoder;
import org.noear.snack4.Feature;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.serialization.snack4.Snack4StringSerializer;

@Configuration
public class DemoConfig {
  @Bean
  public void config(Snack4StringSerializer serializer) {
    serializer.addEncoder(Model.class, new ModelEncoder<>());

    serializer.getDeserializeConfig().addFeatures(Feature.Write_OnlyUseSetter);
  }
}
